<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%--引用标签--%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<%@ include file="/WEB-INF/include/head.basic.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>数据查询</title>
<script type="text/javascript">
</script>
</head>
<body>
	<form:form action="search"  id="search" modelAttribute="purchaseOrder">
    <fieldset class="fieldset-self">
        <legend>查询条件</legend>
        <table align="center">
            <tr align="center">
                <td style="padding-right: 80px;" align="right">采购单号：<form:input path="id" cssClass="easyui-textbox"/></td>
                <td style="padding-right: 80px;" align="right">采购单名称：<form:input path="title" cssClass="easyui-textbox"/></td>
                <td><a href="###" class="easyui-linkbutton" iconCls="icon-search" onclick="$('#search').submit();">查询</a></td>
           </tr>
        </table>
    </fieldset>
</form:form>
<div id="tipInfos"></div>
<table id="stupidtable" width="100%" align="center" class="table">
	<thead>
		<tr>
			<th>序号</th>
			<th>采购单名称</th>
			<th>采购预算</th>
			<th>创建人</th>
			<th>创建时间</th>
			<th>状态</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach items="${purchaseOrderList}" var="bean" varStatus="status">
			<tr onmouseover="this.bgColor='#EAF2FF'" onmouseout="this.bgColor='#FFFFFF'" align="center">
            <th style="background-size: 100%;">${(pageInfo.pageNo - 1) * pageInfo.pageSize + status.index + 1}</th>
            <td align="left">${bean.title}</td>
            <td align="left">${bean.budget}</td>
            <td align="left">${bean.createUser}</td>
            <td align="left"><fmt:formatDate value="${bean.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
            <td align="left">
            	<span style="color:green">
            	<c:if test="${bean.status==2}">
            		<b>已完成</b>
            	</c:if>
            	<c:if test="${bean.status==1}">
            		<b>正在处理中</b>
            	</c:if>
            	<c:if test="${bean.status==null || bean.status==''}">
            		<b>未提交</b>
            	</c:if>
            	</span>
            </td>
            <td align="center">
            	<c:if test="${bean.status==null || bean.status==''}">
            		<c:url var="url" value="./createPurchaseOrder">
                		<c:param name="purchaseOrderWithProcess.id" value="${bean.id}"/>
            		</c:url>
                	<a href="${url}" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">修改</a>
            	</c:if>
            	<c:url var="url1" value="./createPurchaseOrder">
               		<c:param name="purchaseOrderWithProcess.id" value="${bean.id}"/>
               		<c:param name="operate" value="1"/>
            	</c:url>
                <a href="${url1}" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">查看</a>
            </td>
		</c:forEach>
	</tbody>
	<tfoot>
    <tr>
        <td colspan="7">
            <c:if test="${fn:length(purchaseOrderList) > 0}">
                <div align="right">
                    <p:createPager curPage="${pageInfo.pageNo}" totalCount="${pageInfo.count}"
                                   pageSize="${pageInfo.pageSize}" totalPage="${pageInfo.total}" formId="search"/>
                </div>
            </c:if>
        </td>
    </tr>
    </tfoot>
</table>
</body>
</html>